home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / cli / gulamdoc.arc / GULAM.DOC next >
Text File  |  1987-11-02  |  76KB  |  2,026 lines

  1. Info file gulam.info, produced by texinfo-format-buffer   -*-Text-*-
  2. from file gulam.texinfo
  3.  
  4.  
  5.  
  6. File: gulam.info  Node: top, Up: (DIR), Next: usage
  7.  
  8. Introduction
  9. ============
  10.  
  11. *Gulam* is a shell (i.e., a command line interpreter) for AtariST
  12. computers.  It contains some 60+ built-in commands, provides file name
  13. completion a la *TENEX*, has history, alias and rehash
  14. facilities, and integrates the shell with microEmacs easing the
  15. editing of commands being issued.  Among the built-in commands are
  16.  
  17. `egrep'     
  18.      a regular expression based string  pattern  finder.
  19. `te'     
  20.      a simple terminal emulator.
  21. `rx/sx'     
  22.      Xmodem  file  transfers
  23. `pr'     
  24.      a text file printer with pagination.
  25.  
  26. In common usage, it resembles *csh* of *Unix 4.xBSD*;
  27. Gulam's control structures, lexical conventions and other details are,
  28. however, quite different from csh.  While I have borrowed ideas from
  29. other shells (such as Korn shell), I made no heroic attempts to be
  30. compatible with any.  Where possible, I have tried to make
  31. *Gulam* less `surprising' in what it does.
  32.  
  33. The word *Gulam* is pronounced as *Gulaam* in Hindi/Urdu,
  34. and means an obedient servant.
  35.  
  36. *Gulam* is a free program; you are encouraged to give it to others,
  37. but at no cost.  However, the source is copyrighted (i.e., it is not in the
  38. public domain) and will be part of a book on systems programming I am
  39. writing.  The source is available on request, with the usual provisos
  40. regarding material in manuscript form.  This manual is written in the
  41. *TeXinfo* format (the *GNU* documentation format); a laser-printed
  42. TeX-typeset copy of this 40-page manual is also available at cost ($2.00).
  43.  
  44. I am advised to include a disclaimer because there are unreasonable people
  45. out there.
  46.  
  47. "I make no warranty with respect to this manual, or the program it
  48. describes, and disclaim any implied/explicit suggestions of usefulness for
  49. any particular purpose.  Use this program only if you are willing to assume
  50. all risks, and damages, if any, arising as a result, even if it is caused
  51. by negligence or other fault."
  52.  
  53. The first release of this program did contain bugs.  The present
  54. beta-version (dated Sept 1987) is a result of fixing 15 bugs, 9 internal
  55. code improvements (about 180 lines of rewriting), 9 user-visible
  56. improvements.  I am sure this version too has bugs, and undesirable
  57. features.  Users are encouraged to tell me both good and bad things about
  58. this program.
  59.  
  60.  
  61. Many thanks to: Jwahar R.  Bammi for help in every aspect during the
  62. writing of the shell and this manual, and demanding that
  63. *Gulam* be a `reasonably full fledged' shell; David Conroy for
  64. writing a `small is beautiful' microEmacs; Henry Spencer for the
  65. regexp(3) package that is now built into *Gulam*; AtariST for
  66. its value to price ratio.  The program was developed using Megamax and
  67. Mark Williams C compilers.  It now uses my own malloc.c.
  68.  
  69.  
  70.  
  71. Comments on the Present Implementation
  72. ======================================
  73.  
  74. I find the present implementation eminently useable, and indeed use it
  75. all the time, in preference to other shells.
  76.  
  77. Here are some features that I (still) find unsatisfactory.  Control
  78. structures are quite ad-hoc, and incomplete.  I had a tough time in
  79. decreeing that the typical `+-*/()[]{}' are not delimiters; but
  80. that decision made *Gulam* smaller.
  81.  
  82. Here is a list (complete?) of things new and/or diffrent from the
  83. alpha-version.
  84.  
  85.   1. the bugs causing memory-lossage have been fixed.
  86.   2. an application program can now call one of *Gulam*'s routines
  87.      that is equivalent to system() call.
  88.   3. an application program can now call one of *Gulam*'s routines
  89.      that can receive keyboard input from the user, with all the facilities of
  90.      `ue', and return the line input by the user.
  91.   4. `ue' can now insert-file.
  92.   5. stdout append-redirection (`>>') is now implemented.
  93.   6. a new sub-word consisting of three dots `...' expands to the list
  94.      of all filenames rooted at the current or given directory.
  95.   7. doing a `set path <path-list>' will also cause an automatic
  96.      `setenv PATH <path-list> ; rehash'.
  97.   8. `ue' can now fill-paragraph.
  98.   9. new shell variable `verbosity' controls how silent *Gulam* is.
  99.  10. cp will not copy directories and their contents unless
  100.      given the `-r' flag.
  101.  11. `ue' can now use mouse movements as cursor
  102.      movements (see mscursor).
  103.  12. diskettes can be formatted (single/double-sided) in TOS standard way.
  104.  13. the command mem can not only report the GEMDOS free-list but also the list
  105.      of GEMDOS Malloc-ated chunks.
  106.  14. shaded background on the screen is provided for the `gem' command.
  107.  15. the keypad keys can be toggled to become numeric
  108.      or extra-function keys.
  109.  16. there are 3 separate key-bindings for the one *gulam* buffer, and
  110.      the one *mini* buffer, and all the regular buffers.
  111.  
  112.  
  113. File: gulam.info  Node: usage, Prev: top, Up: top, Next: lexical-conventions
  114.  
  115. General Usage
  116. =============
  117.  
  118. The syntactic details of individual commands, and the specific rules that
  119. are followed in evaluating them are given later.  This section is an
  120. overview of how the integration of `ue' with a shell is used.
  121.  
  122. The moment you enter *Gulam*, you are in a ue-buffer
  123. called *mini*.  Thus, all the typical `ue' text-editing
  124. functions are available, except commands such as `Visit-file',
  125. `Switch-to-buffer', etc.  The `RETURN' key causes the entire
  126. line (on which the return is typed) to be evaluated.  The output, if
  127. any, of the command you issued appears on the screen but does not
  128. enter any ue-buffer.  The built-in command `ue' (without any
  129. arguments) takes you into the special ue-buffer named *gulam*;
  130. the output of (built-in) commands issued while you are in *gulam*
  131. does enter that buffer, which can be freely edited.  The command
  132. `ue' FILENAME will read-in each of the named files into
  133. their ue-buffers.  From within `ue', you can
  134. `Switch-to-Gulam-buffer' (whose default binding is `ESC-g').
  135.  
  136. To conserve/manage memory, we release all `ue' buffers when `ue'
  137. is exited in the usual way (i.e., `UNDO', or `^X-^C');
  138. exiting temporarily via the `^Z' does not release memory.
  139. Issuing a substantial number of commands through the *mini* buffer,
  140. without entering `ue' in between, will accumulate all the commands
  141. (but not their output) in the *mini* buffer, and soon there will be a
  142. memory shortage.  To prevent this, enter and exit `ue' once in a
  143. while, or delete (using `^D', or `Delete') characters in the
  144. *mini* buffer.
  145.  
  146.  
  147.  
  148.  
  149. File: gulam.info  Node: lexical-conventions, Prev: usage, Up: top, Next: command-processing
  150.  
  151. Lexical Conventions
  152. ===================
  153.  
  154. All  input  to  *Gulam*  is  case-sensitive; on the other hand, TOS
  155. file names are case-independent.  
  156.  
  157. The  evaluation  of  the command line  begins by dividing it into
  158. "words" and "subwords".  The "word-delimiters" are: 
  159.  
  160.      space   tab     return  line-feed       (the so-called white chars)
  161.      single-quote    double-quote
  162.      semicolon       vertical-bar
  163.  
  164. Note that  `+-*=/()[]{}' etc. are *not* "word-delimiters".  A
  165. "word"  is  either
  166.  
  167.    * A  sequence  of  chars  not containing any "word-delimiters".
  168.    * A  string  of  arbitrary chars enclosed in single/double-quotes.
  169.    * A `semicolon'.
  170.    * A `vertical-bar'.  
  171.  
  172. Eg,  the lines below 
  173.  
  174.      date  01-22-87-22:08:34  #sets the TOS and ikbd date and time
  175.      alias cl 'mmcc e:\gulam\$1.c; cp e:\gulam\$1.o .; linkmm l.lnk'
  176.      if    {$x + $y ==23 }
  177.      if    { -e $1.c }
  178.  
  179. would be divided into the words (shown between slashes) 
  180.  
  181.      /date/01-22-87-22:08:34/#sets/the/TOS/and/ikbd/date/and/time/
  182.      /alias/cl/'mmcc e:\gulam\$1.c; cp e:\gulam\$1.o .; linkmm l.lnk'/
  183.      /if/{$x/+/$y/==23/}/
  184.      /if/{/-e/$1.c/}/
  185.  
  186. "Comments" begin  with  a  word  whose first char is `#', and
  187. end  at  the  end  of line.  A `#' embedded in the middle of a word
  188. does not begin a comment.  
  189.  
  190. The "subword-delimiters" are the characters in
  191. `!@#$%^&-=+`~{}:;'"\|,.<>/'.
  192.  
  193.  
  194. File: gulam.info  Node: command-processing, Prev: lexical-conventions, Up: top, Next: batch-files
  195.  
  196. Outline of Command Processing
  197. =============================
  198.  
  199. The command line is string pre-processed as described below before invoking
  200. it as a command.
  201.  
  202.    * History substitutions occur first.
  203.    * Dollar substitutions, wiggle  expansion,  meta  expansions  occur second.
  204.    * Split the resulting  line  into semi-colon separated commands.
  205.    * For each command,  alias  expand  it,  and  dollar-substitute.
  206.    * Execute each resulting command.  
  207.  
  208.  
  209. File: gulam.info  Node: batch-files, Prev: command-processing, Up: top, Next: buffers
  210.  
  211. Batch Files
  212. ===========
  213.  
  214. A "batch file", also called a shell file, is a text file containing
  215. *Gulam* commands, both internal and external.  Such files must have
  216. the extension `.g' for them to be recognized as commands.  See the
  217. section on `gulam.g' for an example shell file.
  218.  
  219. In processing these files *Gulam* uses `ue' buffers.  So, if
  220. you have `ue' as a command in a batch file, and then exit `ue'
  221. with either `UNDO' or `^X-^C', all the buffers
  222. (including the one holding the batch file) will be released, and
  223. *Gulam* will surely crash. So, do *NOT* include `ue' as a
  224. command in a shell file.
  225.  
  226. Redirections to/from batch files do not work properly.
  227.  
  228.  
  229. File: gulam.info  Node: buffers, Prev: batch-files, Up: top, Next: command-line-editing
  230.  
  231. Buffers: Gulam, Mini and Regular Buffers
  232. ========================================
  233.  
  234. Once you invoke *Gulam*, you are always in one of the microEmacs
  235. (*uE*) "buffers" which are reservoirs of text.  In this program, a
  236. typical line-oriented command shell is integrated with microEmacs.  This
  237. necessitated two special kinds of buffers, named *gulam* and
  238. *mini*, along with the regular buffers.
  239.  
  240. Right after you invoke *Gulam*, you are in *mini*, and each
  241. line you type is taken as a *Gulam* command, and executed.  Any
  242. output produced by such a command is displayed on the screen but not
  243. entered into any microEmacs buffer.  Should you desire to capture such
  244. output into a buffer, enter the *gulam* buffer by typing `ue'
  245. without any arguments.  If you are editing in a regular buffer elsewhere in
  246. microEmacs, pressing `ESC-g' (see `uekb' below for
  247. `switch-to-Gulam-buffer') will get you into *gulam*.
  248.  
  249. While you are in *Gulam*, the `RETURN' key behaves as it does in
  250. *mini*.  All command input, including giving the names of buffers
  251. within `ue', takes place in *mini*.  The window for this buffer
  252. is always at the bottom of screen, and usually only one-line high.  (Some
  253. of you may want to experiment with `^X-^Z' and
  254. `^X-z'.) You enter the *mini* either because (A) you are
  255. outside the normal microEmacs, or (B) a command such as
  256. `Switch-to-buffer' wants to read your input.  The *mini* is like
  257. any other buffer except for the bindings of a few keys, and the disallowing
  258. of `ue' functions that change/switch buffers/windows/files.  One of
  259. these exceptional keys (in *mini*) is the `RETURN' key: it will
  260. submit the entire line -- even if the cursor was somewhere in the middle of
  261. the line-- to the shell (case A), or to such `ue' commands as
  262. `Visit-File' (case B).  Until you press `RETURN', you can edit not
  263. only that line but others in *mini* just as you would in regular
  264. buffers.
  265.  
  266. Note that unless you occasionally exit microEmacs with
  267. `^X-^C' or `UNDO', both *gulam* and *mini*
  268. buffers will keep growing, and you may run out of memory.
  269.  
  270.  
  271. File: gulam.info  Node: command-line-editing, Prev: buffers, Up: top, Next: invoking-gulam
  272.  
  273. Command Line Editing
  274. ====================
  275.  
  276. Full microEmacs editing is available while typing the command.  Thus, you
  277. can transopse chars by `^T', and go to the beginning of the line
  278. by `^A', and ^Yank in a perviously deleted word, etc.
  279.  
  280. In addition to these, there are three convenience features.  After typing
  281. the first few chars of a file name, if you press the key marked
  282. `INSERT', *Gulam* will attempt to complete the file name;
  283. pressing `CLR/HOME' will show all possible completions.  Secondly, if
  284. you type `!n' and then press `INSERT', you will see that the
  285. history-expanded result is brought into the buffer, which can then be
  286. further edited if necessary.  Thirdly, pressing the `DOWNARROW' key
  287. will cycle you through the previous commands.
  288.  
  289.  
  290.  
  291. File: gulam.info  Node: invoking-gulam, Prev: command-line-editing, Up: top, Next: Glossary
  292.  
  293. Invoking Gulam
  294. ==============
  295.  
  296. *Gulam* can be used in four ways.  Two of these four use `TOS'
  297. variable named `_shell_p' (at `0x04f6L').  This (supposedly)
  298. contains a pointer to a routine that takes a string as an argument and
  299. executes it as a shell command.  *Gulam* has slightly extented this.
  300. `*_shell_p', as set by *Gulam*, points the bottom of a (jump)
  301. table, which currently is:
  302.  
  303.              .long   0x86420135        / our magic number
  304.              jmp     getlineviaue_
  305.      togu_:  jmp     callgulam_
  306.  
  307. Thus, `*((long *) 0x04f6L)' == address of `togu_'.  Before
  308. invoking either routine, it always is a good idea to check if the magic
  309. number is present.  Let `mp = *((long *) 0x04f6L) - 12L'.  Then,
  310. `*mp' better be `0x86420135'.
  311.  
  312.   1. The most common usage is as an (outermost) interactive shell.
  313.      Double-click on `gulam.prg'.  Keep your version of `gulam.g' also
  314.      in the same folder.
  315.   2. `int callgulam(p) char *p;' returns the status of executing
  316.      shell command given as a string pointed by `p'.  Let `fp =
  317.      *((long *) 0x04f6L)'.  Then to call this routine, you do `(*fp)(p)'.
  318.   3. `void getlineviaue(p) char *p;' returns in the user-supplied
  319.      array of chars pointed by `p' the command line typed by the user.  Full
  320.      uE editing facilities are available in this inputting process.  `p' must
  321.      point to an array of at least 256 chars; longer input lines cannot be
  322.      given.  The line may contain control characters (inserted by the ^Q
  323.      feature of `ue').  It is ascii NUL terminated.  Let `fp = *((long *)
  324.      0x04f6L) - 6L'.  Then to call this routine, you do `(*fp)(p)'.
  325.   4. For non-interactive use, *Gulam* can be invoked (from shells, from
  326.      application programs via `Pexec()', or `callgulam()') with arguments.
  327.  
  328. `gu 'ls -l' 'echo hello'' is similar to typing the two commands to the
  329. shell in interactive mode.
  330.  
  331. `gu 'pwd' -c scrpt a b c d' does `pwd', and then invokes the
  332. (presumably valid) *Gulam* shell script named `scrpt.g' with
  333. `a b c d' as the script files arguments.  Following the `-c'
  334. must be the name of a batch file.
  335.  
  336. *Gulam* has no other options.
  337.  
  338.  
  339. File: gulam.info  Node: Glossary, Prev: invoking-gulam, Up: top, Next: top
  340.  
  341. Glossary
  342. ========
  343.  
  344.  
  345. File: gulam.info  Node: builtins, Prev: Glossary, Up: Glossary, Next: cd
  346.  
  347.  
  348. Builtin Commands
  349. ----------------
  350.  
  351. A command executed directly by the shell is called a "built-in"
  352. command.  The 62 built-in commands of *Gulam* are:
  353.  
  354.      alias    dm       endwhile help     more     printenv set      ue 
  355.      cat      dirc     exit     history  mson     pushd    setenv   unalias 
  356.      cd       dirs     fg       if       msoff    pwd      source   unset 
  357.      chmod    echo     fgrep    kb       mv       rehash   sx       unsetenv 
  358.      copy     egrep    foreach  lpr      peekw    ren      te       which 
  359.      cp       ef       format   ls       pokew    rm       teexit   while 
  360.      date     endfor   gem      mem      popd     rmdir    time     
  361.      df       endif    grep     mkdir    print    rx       touch    
  362.  
  363.  
  364. File: gulam.info  Node: alias, Prev: Glossary, Up: Glossary, Next: cat
  365.  
  366. alias
  367. -----
  368.  
  369. The `alias' built-in command works almost like a shell file but one
  370. that is stored in the internal data structures of *Gulam*.  It often
  371. just specifies a shorter or different name for a command.
  372.  
  373.      alias cc c:\megamax\mmcc.ttp    #1
  374.      unalias cc                      #2
  375.      alias cl 'mmcc e:\gulam\$1.c; cp e:\gulam\$1.o .; linkmm l.lnk' #3
  376.      alias r  'echo $1.c $1.o; r'    #4
  377.      alias                           #5
  378.      alias g 'echo $3 $1'            #6
  379.      alias cg 'f:\cc.ttp -c -V -Ie:\gulam -DMWC e:\gulam\$1.c' #7
  380.  
  381. Alias without args (see #5) lists all the aliases that are currently
  382. defined.  The command unalias (see 2) removes the def of an alias.  Line 4
  383. shows a recursive definition; try it out!  If we invoke `g' as in
  384. `g a b c d e f' this is equivalent to `echo c a d e f'; i.e., all
  385. arguments above the highest that was used in a "$-substitution" are
  386. appended to the resulting command string before executing it.
  387.  
  388.  
  389. File: gulam.info  Node: cat, Prev: alias, Up: Glossary, Next: cd
  390.  
  391. cat
  392. ---
  393.  
  394. This command `catenates' files to the standard output (normally screen).
  395. By redirecting output, you can concatenate several files into a combined
  396. file.
  397.  
  398.      cat f1 f2 >f3    # f3 will now equal f1 followed by f2
  399.      cat f1 > prn:    # print the file f1 as is; see also print and lpr
  400.      cat f1        # show it on the screen; use ^S/^Q to stop/go
  401.  
  402.  
  403. File: gulam.info  Node: cd, Prev: cat, Up: Glossary, Next: chmod
  404.  
  405. cd
  406. --
  407.  
  408. The `cd' command changes the current working directory; it also sets
  409. the shell variable named `cwd', the environment variable
  410. named  `CWD'.  If `cd' was given noarguments,  it is equivalent
  411. to `cd $home'.
  412.  
  413.  
  414. File: gulam.info  Node: chmod, Prev: cd, Up: Glossary, Next: cp
  415.  
  416. chmod
  417. -----
  418.      chmod [+-w] FILENAMES
  419.  
  420. `chmod'  changes  the  read/write  attributes of the files: `+w'
  421. makes them read-write, and `-w' makes them read-only.  
  422.  
  423.  
  424. File: gulam.info  Node: cp, Prev: chmod, Up: Glossary, Next: date
  425.  
  426. cp
  427. --
  428.      cp FILENAMES TARGET-DIR
  429.      cp FILENAME1 FILENAME2
  430.  
  431. Copies files.  In the first form, any number of files may be copied into
  432. the destination directory; files in the target dir will have their original
  433. names.  In the second form, only one file is copied, and the new one will
  434. be named filename2.
  435.  
  436.      cp FNM FNM    # will exit with status -1 
  437.      cp -r D1 DIR2     # if d1 is a directory, this command will
  438.                    # create a dir named d1 in dir2, and copies
  439.                    # all the files in d1 to to dir2\d1 
  440.  
  441. In the second example above, if -r option is omitted, cp will ignore any
  442. directory names in the list of source files.  Use the -r option with
  443. caution.  E.g.,
  444.  
  445.      cp -r d1  d1\d2 # is dangerous 
  446.  
  447. will, assuming that d1\d2 is a directory, copy/create subtree d1 inside d2.
  448. But, the problem is that d1 will keep growing as a result until of course
  449. there is no more room on the target disk!
  450.  
  451. A simple way to print a file as is, instead of using lpr or print, is to
  452.  
  453.      cp fnm prn: 
  454.  
  455. There is a `+t' option that gives the created target files the time
  456. and date of the source files.  If you care about this, you may want to set
  457. up an alias as in:
  458.  
  459.      alias cp 'cp +t' 
  460.  
  461.  
  462. $cwd and $CWD
  463. -------------
  464.  
  465. The shell variable named `cwd' (and env var named `CWD') holds the
  466. full path name of the current working directory.  
  467.  
  468.  
  469. File: gulam.info  Node: date, Prev: cp, Up: Glossary, Next: df
  470.  
  471. date
  472. ----
  473.  
  474. The `date' command, without arguments, prints the current date and
  475. time.  With arguments, it sets the date and time.  
  476.  
  477.      date 01-22-87-22:08:34 
  478.  
  479. will set the date to Jan 22, 87 and time to 10:08:34 pm.  Instead of hyphen,
  480. and colon, other delimiters can be used, as long as the whole argument of date
  481. is still one word.
  482.  
  483.  
  484. File: gulam.info  Node: df, Prev: date, Up: Glossary, Next: dm
  485.  
  486. df
  487. --
  488.      df DRIVENAMES
  489.  
  490. `df'  shows the free space on the asked for drive(s); e.g.,
  491.      df a c f
  492.  
  493.  
  494. File: gulam.info  Node: dm, Prev: df, Up: Glossary, Next: dirc
  495.  
  496. dm
  497. --
  498.  
  499. `dm' (drive map) gives a string of letters that stand for the
  500. installed drives.
  501.  
  502.  
  503. File: gulam.info  Node: dirc, Prev: dm, Up: Glossary, Next: dirs
  504.  
  505. dir cache dirc
  506. --------------
  507.  
  508. To help do the Tenex file name completion efficiently, there is a cache of
  509. contents of directories.  `dirc' shows the names of these dirs, and
  510. how many bytes are used by their contents.  Unless you did a `set
  511. dir_cache 1', or you executed commands that only examine the file system
  512. the `dirc' has nothing to show since the cache is flushed at the end
  513. of each command.  Try *Gulam* with `dir_cache' set to 1.  Note
  514. however that this cache is updated only by the `ls' command; so even
  515. after you deleted some files, file name completion may still find those
  516. names.  `dirc -' will explicitly flush the cache.
  517.  
  518.  
  519. File: gulam.info  Node: dirs, Prev: dirc, Up: Glossary, Next: echo
  520.  
  521. dirs
  522. ----
  523.  
  524. *Gulam* has an internal stack of directories whose content is
  525. printed by the `dirs' command.  The built-in commands `pushd',
  526. and `popd' are the only others that operate on this stack.
  527.  
  528.  
  529. File: gulam.info  Node: dollar-substitutions, Prev: command-line-editing, Up: top, Next: expressions
  530.  
  531. Dollar-substitutions
  532. --------------------
  533.  
  534. The subword `$x' in a command is substituted by the value of it.  If
  535. `x' is the name of a shell var, or an environment var, then `$x'
  536. is the value of that variable.  If `x' is an unsigned number, it
  537. stands for the x-th argument; thus, `$0' usually gives the command
  538. name.   `$*'  stands  for the text of the entire command; `$-' stands
  539. for  words  `$1'  to dollar-last; `$<' stands for the on-demand input
  540. given by the user.  
  541.  
  542.  
  543.  
  544. Dotg.g
  545. ------
  546.  
  547. -- see Batch Files, and gulam.g 
  548.  
  549.  
  550. File: gulam.info  Node: echo, Prev: dirs, Up: Glossary, Next: ef
  551.  
  552. echo
  553. ----
  554.  
  555. The `echo' command prints its arguments.  
  556.  
  557.      echo c:\mwc\...    # all the fnms in the dir tree rooted at c:\mwc will be echoed
  558.  
  559.  
  560. File: gulam.info  Node: ef, Prev: echo, Up: Glossary, Next: egrep
  561.  
  562. ef
  563. --
  564. -- see if               (stands for elseif)
  565.  
  566.  
  567. File: gulam.info  Node: egrep, Prev: ef, Up: Glossary, Next: endif
  568.  
  569. egrep
  570. -----
  571. -- see grep
  572.  
  573.  
  574. File: gulam.info  Node: endif, Prev: egrep, Up: Glossary, Next: endfor
  575.  
  576. endif
  577. -----
  578. -- see if
  579.  
  580.  
  581. File: gulam.info  Node: endfor, Prev: endif, Up: Glossary, Next: exit
  582.  
  583. endfor
  584. ------
  585. -- see foreach
  586.  
  587.  
  588. $env style 
  589. -----------
  590.  
  591. This shell var controls the format of the environment string supplied to
  592. the external command invoked through *Gulam*.
  593.  
  594.      set env_style bm # to get a style of env string a la Beckmeyer
  595.      set env_style mw # Mark Williams
  596.      set env_style gu # the "normal" style, a la Unix
  597.  
  598.  
  599. File: gulam.info  Node: exit, Prev: endfor, Up: Glossary, Next: fg
  600.  
  601. exit
  602. ----
  603.      exit [NUMBER]
  604.  
  605. The `exit' built-in command is used to force termination of a shell
  606. script.
  607.  
  608.  
  609. File: gulam.info  Node: expressions, Prev: dollar-substitutions, Up: top, Next: flags
  610.  
  611. Expressions 
  612. ------------
  613.  
  614. An "atomic exp" is either a NUMBER, a FILENAME, a FILE
  615. PREDICATE, a { EXP }, or ! ATOMIC EXP.
  616.  
  617. A FILE PREDICATE on a file name FNM is of the form `-c
  618. FNM' where `c' is in `{e, f, d, h, v, m}'.  These letters
  619. stand for "exists", "is-a-regular-file", "is-a-dir",
  620. "is-a-hidden-file", "is-a-volume-label", and
  621. "is-an-archived-file".  A FILEPRED yields 1 if it is true, 0
  622. otherwise.
  623.  
  624. An arithmetic expression is constructed using the operators `+-/%*'.
  625. All these are of equal precedence and evaluated left-to-right; thus,
  626. `2 + 4 / 2' is equal to 3.  However, the braces raise the precedence
  627. of the ops within them; thus, `2 + { 6 / 2}' is equal to 5.  An exp
  628. with no operators, i.e., an atom, is a special case because we want the
  629. string form of the atom (e.g., as for `blah' in `set s blah').  A
  630. non-numeric string yields 0 as its numeric value in an arith exp.
  631.  
  632. A "relational expression" is of the form `arithexp relation
  633. arithexp', where relation is any one of `<=, <, ==, !=, >,' or
  634. `>='.  Such a relation yields a 1 if it holds, 0 otherwise.
  635. (Relational operators among strings are not implemented yet.)  You may
  636. combine expressions using the boolean operators `&&' and `||'
  637. (which are not, for now, short-circuit evaluated).
  638.  
  639. Note the spaces in the examples above; see Lexical Structure.  
  640.  
  641.  
  642. File: gulam.info  Node: fg, Prev: exit, Up: Glossary, Next: file-names
  643.  
  644. fg
  645. --
  646.  
  647. `fg' is part of the simulation of what we were used to doing on Unix
  648. with GNU-Emacs: get out of it by stopping GNU (`^Z' in ue/Gulam),
  649. do a few shell commands and get back in by `fg' (works the same in
  650. ue/Gulam).
  651.  
  652.  
  653.  
  654. File: gulam.info  Node: file-names, Prev: fg, Up: Glossary, Next: foreach
  655.  
  656. File Names
  657. ----------
  658.  
  659. There are many conveniences in *Gulam* that relate to specifying
  660. filenames.  It can complete a file name given its first few characters.
  661. (Tenex is widely considered to be the first OS to implement this.) Type the
  662. first few characters, and then press the key marked `INSERT' (or
  663. `CLR/HOME'), while you are in *mini*.  If you are in buffer
  664. *gulam*, use `ESC' `ESC' (2 escapes).
  665.  
  666. The canonical form of the full path name of a file begins with a letter
  667. designating the disk drive, followed by a colon, a back-slash separated
  668. list of identifiers.  All but the last of these identifiers must be a
  669. directory name.  In the non-standard form, you may also use a dot `.', and
  670. dot-dot `..' in place of the identifiers in appropriate contexts.  Whenever
  671. *Gulam* completes your filenames, it will produce the standard form
  672. full path names.
  673.  
  674. *Gulam* will standardize, in three situations, non-standard form of
  675. a `path', as shown in the example below.  These situations are:
  676.   1. Tenex file name expansion is inoked.
  677.   2. the word contains meta characters.
  678.   3. the name is being given to one of the file operations in `ue'.
  679.  
  680. `e:\gulam\a:\lex.c' is standarddized to `a:\lex.c'
  681. `e:\gulam\\src\util.c' is standarddized to `c:\src\util.c'
  682. `e:\gulam\~\ex.o' is standarddized to `d:\bin\ex.c'
  683.  
  684. assuming that the current drive was c:\, and home was d:\bin.  This is
  685. especially nice inside `ue' when visiting other files.
  686.  
  687. Words, as given by the you, that contain meta characters (which are
  688. `*?|()[]') or the string `...' are expanded.  In general, one
  689. such word produces a list of file names.  These file name regular
  690. expressions (fnmre) are like regular expressions (re), but have different
  691. semantics.  Occurrences of an fnmre, outside of strings, are replaced by
  692. the sorted blank-separated list of file names matching the fnmre.  An fnmre
  693. differs from re in (1) `.' stands for itself; (2) `*' is matches zero or
  694. more arbitrary characters.  Question mark matches any one character.
  695. `[a-g]' matches any one letter in a, b, ..., g.  `[zen]' matches one of z,
  696. e, or n.  Parentheses serve to group expressions.  An exp `g*' matches file
  697. names that begin with a `g'; `*.c' matches those ending in `.c'
  698.  
  699. The 3 dots, as in `c:\tex\...', stand for all the names
  700. of the files in the subtree at `c:\tex'.  If `c:\tex' has
  701. subdirectories, and so on, all their names and files they contain are
  702. included.  Thus, `echo e:\...\*.c' will show all the `.c'
  703. files in all the directories on drive e.  Remember that `...'
  704. expansion causes many directories to be visited.  This is not only
  705. time consuming, but also seems to trigger the Atari TOS's 40 folder
  706. bug after a few such operations.  (In my tests, I never lost a file as
  707. a result.  Nor can I tell precisely when and in what form this shows
  708. up.  Most frequent indication was that `cd' to an existing drive
  709. would fail.)
  710.  
  711.  
  712. File: gulam.info  Node: flags, Prev: expressions, Up: top, Next: history-substitutions
  713.  
  714. Flags
  715. -----
  716.  
  717. Most commands (built-in or external) take flags to alter the behavior of
  718. the command in a minor way.  The convention made popular by Unix shells is
  719. adopted here for *Gulam*'s built-ins: a flag is of the form
  720. `-C', or `+C', where C stands for one
  721. character.  The option `-i', which interrogates you for each of the
  722. operand of the command before executing it, is provided on most commands.
  723.  
  724.  
  725. File: gulam.info  Node: foreach, Prev: file-names, Up: Glossary, Next: format
  726.  
  727. foreach
  728. -------
  729.  
  730. The `foreach' command is used in shell scripts (but not at the
  731. terminal) to specify repetition of a sequence of commands while the value
  732. of a certain shell variable ranges through a specified list.  The
  733. `foreach' command ends with an `endfor' on a separate line all by
  734. itself.
  735.  
  736.      foreach i { a b c *.o [a-k]*[ch] } 
  737.              echo $i 
  738.      endfor 
  739.  
  740.  
  741. File: gulam.info  Node: format, Prev: foreach, Up: Glossary, Next: gem
  742.  
  743. format
  744. ------
  745.  
  746. This command formats diskettes, in the standard form (360K, or 720K) in
  747. either the `A' or `B' floppy drive.  It does not touch
  748. hard-/ram-disks, no matter what arguments (illegal or not) you give it.
  749. Its valid arguments are either `a', `b', or both.  The optional
  750. flag `-2' implies double-sided formatting; otherwise the diskette is
  751. formatted single-sided.
  752.  
  753.      format        # does nothing 
  754.      format b      # format the floppy in drive B, single-sided 
  755.      format -1 b   # same as format b 
  756.      format -2 a   # format the floppy in drive A, double-sided 
  757.  
  758. If you issue the wrong command (e.g., `format -2 a' on a single-sided
  759. drive), you will hear a lot of grinding noises; a `control-C' will kill
  760. this, but not right away.
  761.  
  762.  
  763. File: gulam.info  Node: gem, Prev: format, Up: Glossary, Next: grep
  764.  
  765. gem
  766. ---
  767.  
  768. The word `gem' is a prefix, like `time' is, to commands.  This
  769. enables proper running via *Gulam* of most programs that use the
  770. desktop metaphor.  It clears screen, turns cursor off, enables mouse and
  771. then executes the command, and after the command is finished it again
  772. clears screen, turns cursor on, disables mouse.
  773.  
  774. The `time' and `gem' prefixes mix in either order, and the
  775. command name will be searched for in the usual way.
  776.  
  777. We do not know, for sure, if all desktop/window/mouse oriented programs can
  778. be run properly with this command prefix.  So experiment, and be ready to
  779. hit the reset button before using the prefix.
  780.  
  781. `dvi' is an example of a command that needs to be run with `gem'
  782. prefix.  And you may be tempted to do the following.
  783.  
  784.      alias dvi 'gem dvi'                   # recurses infinitely 
  785.      alias dzz dvi                         # dzz or whatever 
  786.      alias dvi 'gem dzz'                   # will work 
  787.      alias dvi 'gem c:\bin\dvi.prg'        # also will work 
  788.  
  789.  
  790. File: gulam.info  Node: grep, Prev: gem, Up: Glossary, Next: gulam.g
  791.  
  792. grep/egrep/fgrep
  793. ----------------
  794.      grep/egrep/fgrep RE-PATTERN FILENAMES
  795.  
  796. The `grep' command searches through a list of argument files for a
  797. specified string.  Thus
  798.  
  799.      grep lex[aw] e:\gulam\*.c 
  800.  
  801. will print each line in the files that contains a substring matching
  802. `lex[aw]'. `grep' stands for "globally find regular expression
  803. matches and print". `grep' and `egrep' are one and the same.
  804. The first argument to `egrep' is a regular expression, and the rest
  805. are expected to be file names. `fgrep''s first argument is the as-is
  806. string to be searched for in the files.  Because of the preprocessing done
  807. by *Gulam*, the as-is string for `fgrep' or the regular exp for
  808. `egrep' is generally enclosed in single-quotes.
  809.  
  810.  
  811. File: gulam.info  Node: gulam.g, Prev: grep, Up: Glossary, Next: help
  812.  
  813. gulam.g
  814. -------
  815.  
  816. Files with the `.g' extension are expected to contain *Gulam*
  817. commands; `gulam.g' is the name of the startup file.  *Gulam*
  818. attempts to find this file in the current directory, and if found executes
  819. its contents.  Here is an example file:
  820.  
  821.      # bgn of my gulam.g
  822.      
  823.      set prompt      '$ncmd $cwd gu > $u'
  824.      set histfile    e:\history.g
  825.      set baud_rate   9600
  826.      set sz_rs232_buffer     4096
  827.      set rgb '005-707-070-075-' # set the palette; note the trailing '-'
  828.      # the following sets tabs on Epson MX-80
  829.      set pr_bof '^Q033^QD^Q010^Q020^Q030^Q040^Q050^Q060^Q070^Q033^QC^Q102'
  830.      set pr_eof '^Q214'
  831.      set pr_eop '^Q214^Qn'
  832.      set pr_eol '^Qr^Qn'
  833.      
  834.      #setenv PATH c:\bin,d:\bin,f:    # no trailing back slashes
  835.      #rehash
  836.      set path c:\bin,d:\bin,f:        # this is equiv to above 2 lines
  837.      setenv TEMP f:\
  838.      alias h   history
  839.      alias ll  ls -lF
  840.      alias p   more
  841.      alias rm rm -i # asks before deleting
  842.      alias ug 'ue e:\gulam\$1.c'
  843.      alias cg 'f:\cc.ttp -c -V -O -Ie:\gulam -Ie:\ue -DMWC e:\gulam\$1.c'
  844.      alias cpall 'cp e:\ue\*.o e:\gulam*.o f:\ '
  845.      alias bk 'cp e:\ue\*.[ch] e:\gulam\*.[ch] e:\gulam\mwc.s a:\ '
  846.      # end of my gulam.g
  847.  
  848.  
  849. Gulam Variables and Environment
  850. -------------------------------
  851.  
  852. The following shell variables cause/control useful effects.  The format of
  853. the explanation is `variable_name: default-value meaning'.
  854.  
  855. `batch_max_nesting: 20'     
  856.      if you need to nest batch file execution at levels deeper than this,
  857.      change this variable.
  858. `batch_echo: 0'     
  859.      if  1  echoes each command of the batch file as it is executed.  
  860. `baud_rate: none'     
  861.      for  use  in  the  terminal  emulator, rx/sx file transfers.  
  862. `cwd:'     
  863. `CWD: full  pathname  of  current directory'     
  864.      gets re-set every time a cd, pushd or popd is executed.  
  865. `delay: unset'     
  866.      set it to control the duration that the cursor sits
  867.      on a matching paren, bracket, or brace.  A value of 2000 produces about
  868.      a 2-sec delay.
  869. `dir_cache: 0'     
  870.      if non-0, turns on the dir list cache.  This substantially speeds up the
  871.      Tenex file name completion.
  872. `gulam_help_file: unset'     
  873.      set this variable to the full path name of
  874.      the file containing the supplied `gulam.hlp' file.
  875. `home'     
  876. `HOME: full   pathname   of   home  directory'     
  877.      home  is  the directory you were in before invoking *Gulam*.  
  878. `ginprompt: $<'     
  879.      the  prompt  shown  when  asking you for input in dollar-substituting a $<.
  880. `gulam_help_file: none'     
  881.      set  this  var  to the full pathname of the
  882.      `gulam.hlp' file,  which contains descriptive info about keys,
  883.      functions, bindings and commands.  Unless this var is set
  884.      properly,  the  wall  chart  that `ue' generates is of not much use.  
  885. `histfile: none'     
  886.      reads and saves history in file named $histfile .
  887. `ncmd: number  of  the  current  command'     
  888.      gets  set  after each executing each command.  
  889. `mscursor: unset'     
  890.      set it to a string of 4 digits (e.g., "0508").  This
  891.      controls the scaling of mouse movements being turned into cursor keys.  If
  892.      it is set to "0000", mouse movements do not get translated to cursor keys.
  893. `path: unset'     
  894.      when  set,  it  will cause the environment variable
  895.      PATH  to  be  automatically  also  set  to  the  same  string
  896.      ($path), and cause rehashing.  
  897.  
  898. The following pr_XXX vars are relevant with `print', and `lpr'
  899. commands.  When set, these strings are sent to the printer :
  900.  
  901. `pr_bof: unset'     
  902.      send before printing each new file.
  903. `pr_eol: rn'     
  904.      send after each line.
  905. `pr_eop:214'     
  906.      send after each page (214 == ASCII ^L + 0200). 
  907. `pr_eof: 214'     
  908.      send after the end of file.  
  909.  
  910. Thus, to have a left margin of eight-spaces, just define `pr_eol' as
  911. `rnt'.  To turn condensed mode etc., just set
  912. `pr_bof' to the appropriate string after looking it up in the
  913. printer's manual.  See the section on strings for an explanation of
  914. .
  915.  
  916. `prompt: >>'     
  917.      see gulam.g for an example.
  918. `prompt_tail: unset;'     
  919.      when set,   $prompt_tail  is  appended  to  the  displayed  prompt
  920.      string.   This is a kludge to mollify those of you who insist
  921.      on having a trailing blank in their prompt! 
  922. `rgb'     
  923. `RGB: `000-700-007-070-''     
  924.      sets  the  palette:  3 octal digits (followed by a  dummy  '-')  per
  925.      color;  2  in  hi-rez,  4  in med-rez, 16 in low-rez.
  926. `rx_remote_cmd: unset'     
  927.      command  to  send  to remote to receive file
  928.      with  Xmodem.   For  our  Unix, this string is `xm st'.  The rx
  929.      command  appends  a space followed by the file name and sends
  930.      the resulting string to the remote as if you typed it.  
  931. `sx_remote_cmd: unset'     
  932.      command to send to remote to send file with Xmodem.  Similar to the above.  
  933. `semicolon_max: 20'     
  934.      Number  of `;' per line; to stop infinite recursions in alias expanded
  935.      commands.
  936. `status'     
  937.      status  of  the  most  recent external command; set after each external
  938.      command.
  939. `sz_rs232_buffer: unset'     
  940.      The  built-in  terminal  emulator,  when invoked,  will  reallocate  a
  941.      buffer  of  this size (if this value  is  >  256) for the associated IOREC.
  942.      If unset, or if set  but  to  a  value  lower  than  4096, you may experience
  943.      XON/XOFF occuring at 9600.  I recommend 4096.
  944. `time: unset'     
  945.      If set to non-0, times every command.  
  946. `verbosity: unset'     
  947.      This controls the amount of feed back you get from *Gulam*.  When
  948.      unset, or set to <= 0, *Gulam* will be extremely quiet, and report
  949.      only on errors.  If you wish commands like `cp' to report the
  950.      goings-on, set verbosity to 2.
  951.  
  952.  
  953. HELP
  954. ----
  955.  
  956. The all-upper case name `HELP' in this manual stands for the key marked
  957. `HELP' on the Atari ST.  Pressing this key, outside the `ue', will
  958. show all the *Gulam* built-in commands, and a brief version of the
  959. hash table.  Within `ue', it can show the binding of an individual
  960. key, or produce a wall-chart of all bindings.
  961.  
  962. The `shift-HELP' key resets the special key table mapping that Gulam/uE
  963. use; after pressing `shift-HELP' the function keys, and arrow keys
  964. become equivalent to `^@', and the keypad will work as a typcial
  965. numerical keypad.  To get back to the Gulam/uE key table, press
  966. `^L', which not only refreshes the display but also sets the key
  967. table.
  968.  
  969.  
  970. File: gulam.info  Node: help, Prev: grep, Up: Glossary, Next: history
  971.  
  972. help
  973. ----
  974.  
  975. Typing the letters `help' while outside `ue', or in buffer
  976. *gulam* is equivalent to pressing `HELP'.
  977.  
  978.  
  979. File: gulam.info  Node: history, Prev: help, Up: Glossary, Next: if
  980.  
  981. history
  982. -------
  983.      history [-h]
  984.  
  985. The `history' command lists the last N commands.  Each command is
  986. preceded by its number; to suppress these numbers, supply the `-h'
  987. flag.  The value N is obtained by `$history'.  To change this N to,
  988. say, 30, do `set history 30'.
  989.  
  990.  
  991. File: gulam.info  Node: history-substitutions, Prev: flags, Up: top, Next: io-redirection
  992.  
  993. History Substitutions
  994. ---------------------
  995.  
  996. Occurrences of the form `!!', `!number', `!string' refer to
  997. the text of previously issued commands.  The text of these older commands
  998. itself does not contain `!' unless it is part of a string argument.
  999. Each `!!' is replaced by the text of the immediately preceding
  1000. command.  *Gulam* consecutively numbers the commands that you have
  1001. issued.  (The current count can be seen in the shell variable named
  1002. NCMD.) Each `!n' is replaced by the
  1003. n-th  old  command.   Each  `!str' is a replaced by the most recent
  1004. old command that begins with str.  
  1005.  
  1006. The name completion feature works with history substitutions also.
  1007. Pressing `INSERT' or `ESC-ESC' will bring the history-matched
  1008. command and replace the current line in the buffer, which you can further
  1009. edit.
  1010.  
  1011.  
  1012. $home also $HOME
  1013. ----------------
  1014.  
  1015. The shell variable "home" is initially set to the full pathname of the
  1016. directory from which *Gulam* was invoked.  However, it can be set
  1017. again with set command to whatever.  The wiggle `~' in file
  1018. names expands to "$HOME".  
  1019.  
  1020.  
  1021. File: gulam.info  Node: if, Prev: history, Up: Glossary, Next: lpr
  1022.  
  1023. if
  1024. --
  1025.  
  1026. The "if" stmt is similar to those in many programming languages.  The
  1027. Boolean expression of shell if stmts typically involves tests on file names
  1028. and types.  (See Expressions.) There is no `then'.  Any remaining
  1029. lexemes after the Boolean exp are ignored.
  1030.  
  1031.      if {-d e:\gulam\lex} + 2 == 3 
  1032.              echo e:\gulam\lex is a dir 
  1033.      ef -e e:\gulam\lex      # read ef as `else if' 
  1034.              echo e:\gulam\lex does exist 
  1035.      ef 
  1036.              echo e:\gulam\lex does NOT exist 
  1037.      endif 
  1038.  
  1039.  
  1040. File: gulam.info  Node: io-redirection, Prev: history-substitutions, Up: top, Next: metacharacter-expansion
  1041.  
  1042. IO Redirection
  1043. --------------
  1044.  
  1045. Prefixing a file name F with `>' causes all standard output
  1046. produced by that command to get deposited into file F.  Similarly,
  1047. `<g' will cause standard input to be taken from the file G
  1048. rather than the key board.  If you prefer, you may include white chars
  1049. between the `<' (or `>' ) and the filename.  If you have more
  1050. than one `<', or `>' in a command all but the last are ignored.
  1051.  
  1052. Note that because of TOS and compiler peculiarities, not all external
  1053. commands will behave as above.
  1054.  
  1055.      ls -l > lsout # get the ls -l output into file lsout
  1056.      ls -l >> f1   # append the ls -l output to f1
  1057.      ecmd '>blah'  # invoke ecmd and give it the arg >blah as is to it.  
  1058.  
  1059.  
  1060. File: gulam.info  Node: kb, Prev: if, Up: Glossary, Next: lpr
  1061.  
  1062. kb
  1063. --
  1064.  
  1065. This command redefines microEmacs keybindings.  To bind key with code 144
  1066. to function with hex-number 1d while you are in the *regular* buffer,
  1067. do
  1068.  
  1069.      kb -r 144 1d      
  1070.  
  1071. Use -g for redefining the bindings of *gulam* buffer; -m for mini
  1072. buffer.  You can find the key codes and hex-numbers of functions in the
  1073. wall-chart (shown below), which can be produced by pressing the `HELP'
  1074. key, a `B', and then a `r' (or `g', or `m').  The key
  1075. names, and function names will not appear unless a `set
  1076. gulam_help_file <filename>' was done earlier.
  1077.  
  1078.      key-code in hex
  1079.      |       function code in hex
  1080.      |       |       key name (uekb ignores this)
  1081.      |       |       |              function name  (uekb ignores this)
  1082.      ---------------------------------------------------------
  1083.      081     5c      F1              kill-backward-word
  1084.      082     5d      F2              kill-word
  1085.      083     20      F3              kill-line
  1086.      084     35      F4              copy-region-as-kill
  1087.      085     51      F5              kill-buffer
  1088.      086     50      F6              list-buffers
  1089.      087     4e      F7              switch-to-buffer
  1090.      088     3f      F8              write-file
  1091.      089     3d      F9              find-file
  1092.      08a     3e      F10             save-buffer
  1093.      08b     14      HELP            help
  1094.      08c     0d      UNDO            quick-exit
  1095.      08d     62      INSERT          scroll-down
  1096.      08e     61      HOME            scroll-up
  1097.      0bb     23      UPARRO          previous-line
  1098.      0bc     0f      DNARRO          gulam-forward-line
  1099.      0bd     1a      LTARRO          backward-char
  1100.      0be     1b      RTARRO          forward-char
  1101.      140     30      C-@            set-mark-command
  1102.      141     1e      C-A             beginning-of-line
  1103.      142     1a      C-B             backward-char
  1104.      143     06      C-C             switch-to-gulam-buffer
  1105.      144     1d      C-D             delete-char
  1106.      145     1f      C-E             goto-end-of-line
  1107.      146     1b      C-F             forward-char
  1108.      147     13      C-G             keyboard-quit
  1109.      148     1c      C-H             backward-delete-char
  1110.      149     11      TAB             goto-next-tab
  1111.      14a     25      LFD             newline-and-indent
  1112.      14b     20      C-K             kill-line
  1113.      14c     19      C-L             redraw-display
  1114.      14d     10      RET             gulam-do-newline
  1115.      14e     0f      C-N             gulam-forward-line
  1116.      14f     22      C-O             open-line
  1117.      150     23      C-P             previous-line
  1118.      151     33      C-Q             quoted-insert
  1119.      152     2b      C-R             search-backward
  1120.      153     2c      C-S             search-forward
  1121.      154     34      C-T             transpose-chars
  1122.      156     61      C-V             scroll-up
  1123.      157     36      C-W             kill-region
  1124.      159     3b      C-Y             yank
  1125.      15a     0e      C-Z             temporary-exit
  1126.      15f     14      C-_             help
  1127.      029     6b      )               blink-matching-paren-hack
  1128.      07d     6b      }              blink-matching-paren-hack
  1129.      05d     6b      ]               blink-matching-paren-hack
  1130.      0c0     0c      KLP             move-window-dn
  1131.      0c1     0b      KRP             move-window-up
  1132.      0c7     4a      KSLASH          split-window-vertically
  1133.      0c2     49      KSTAR           delete-other-windows
  1134.      0c5     45      KMINUS          previous-window
  1135.      0c3     44      KPLUS           next-window
  1136.      0c4     17      KENTER          call-last-kbd-macro
  1137.      0c6     26      KDOT            goto-line
  1138.      0b0     0a      K0              terminal-emulator
  1139.      0b7     55      K7              beginning-of-buffer
  1140.      0b8     32      K8              recenter
  1141.      0b9     54      K9              end-of-buffer
  1142.      0b4     5a      K4              backward-word
  1143.      0b5     23      K5              previous-line
  1144.      0b6     5e      K6              forward-word
  1145.      0b1     1e      K1              beginning-of-line
  1146.      0b2     0f      K2              gulam-forward-line
  1147.      0b3     1f      K3              goto-end-of-line
  1148.      541     09      C-X C-A         show-key-board-macro
  1149.      542     50      C-X C-B         list-buffers
  1150.      543     12      C-X C-C         save-buffers-kill-emacs
  1151.      546     3d      C-X C-F         find-file
  1152.      549     4d      C-X TAB         insert-buffer
  1153.      54f     41      C-X C-O         delete-blank-lines
  1154.      54e     0c      C-X C-N         move-window-dn
  1155.      550     0b      C-X C-P         move-window-up
  1156.      552     08      C-X C-R         read-file
  1157.      553     3e      C-X C-S         save-buffer
  1158.      556     3d      C-X C-V         find-file
  1159.      557     3f      C-X C-W         write-file
  1160.      558     42      C-X C-X         exchange-point-and-mark
  1161.      55a     46      C-X C-Z         shrink-window
  1162.      421     27      C-X !           execute-one-Gulam-command
  1163.      421     07      C-X !           execute-buffer
  1164.      43d     43      C-X =           what-cursor-position
  1165.      428     15      C-X (           start-kbd-macro
  1166.      429     16      C-X )           end-kbd-macro
  1167.      431     49      C-X 1           delete-other-windows
  1168.      432     4a      C-X 2           split-window-vertically
  1169.      442     4e      C-X B           switch-to-buffer
  1170.      445     17      C-X E           call-last-kbd-macro
  1171.      446     18      C-X F           no-op
  1172.      449     3c      C-X I           file-insert
  1173.      44b     51      C-X K           kill-buffer
  1174.      44e     44      C-X N           next-window
  1175.      44f     44      C-X O           next-window
  1176.      450     45      C-X P           previous-window
  1177.      453     52      C-X S           save-some-buffers
  1178.      45a     47      C-X Z           enlarge-window
  1179.      348     5c      ESC C-H         kill-backward-word
  1180.      221     07      ESC !           execute-buffer
  1181.      22e     30      ESC .           set-mark-command
  1182.      23e     54      ESC >           end-of-buffer
  1183.      23c     55      ESC <           beginning-of-buffer
  1184.      25b     56      ESC [           beginning-of-paragraph
  1185.      25d     57      ESC ]           end-of-paragraph
  1186.      225     2f      ESC %           query-replace
  1187.      220     59      ESC SPC         just-one-space
  1188.      242     5a      ESC B           backward-word
  1189.      243     5b      ESC C           capitalize-word
  1190.      244     5d      ESC D           kill-word
  1191.      246     5e      ESC F           forward-word
  1192.      247     06      ESC G           switch-to-gulam-buffer
  1193.      24c     5f      ESC L           downcase-word
  1194.      251     29      ESC Q           fill-paragraph
  1195.      252     2b      ESC R           search-backward
  1196.      253     2c      ESC S           search-forward
  1197.      255     60      ESC U           upcase-word
  1198.      256     62      ESC V           scroll-down
  1199.      257     35      ESC W           copy-region-as-kill
  1200.      27f     5c      ESC DEL         kill-backward-word
  1201.      35b     05      ESC ESC         expand-name-gulam-style
  1202.      344     63      ESC C-D         expand-names-and-show-them
  1203.      346     04      ESC C-F         file-name
  1204.      07f     1c      DEL             backward-delete-char
  1205.      0ab     37      SHIFT-HELP      keys-reset
  1206.      000     00      NUL             no-op
  1207.      000     00      NUL             no-op
  1208.      000     00      NUL             no-op
  1209.      000     00      NUL             no-op
  1210.      000     00      NUL             no-op
  1211.      000     00      NUL             no-op
  1212.      000     00      NUL             no-op
  1213.      000     00      NUL             no-op
  1214.      000     00      NUL             no-op
  1215.      000     00      NUL             no-op
  1216.  
  1217.  
  1218. File: gulam.info  Node: lpr, Prev: if, Up: Glossary, Next: ls
  1219.  
  1220. lpr
  1221. ---
  1222.      lpr FILENAMES
  1223.  
  1224. The command `lpr' prints its files as-is, with no processing at the
  1225. end of lines.
  1226.  
  1227.  
  1228. File: gulam.info  Node: ls, Prev: lpr, Up: Glossary, Next: mem
  1229.  
  1230. ls
  1231. --
  1232.      ls [-lRLF] FILENAMES 
  1233.  
  1234. The `ls' (list files) command, with no arguments, prints the sorted
  1235. list of names of the files in the current directory.  It has a number of
  1236. useful flag arguments, and can also be given the names of directories as
  1237. arguments, in which case it lists the names of the files in these
  1238. directories.
  1239.  
  1240. If no flags are given, `ls' prints only the filenames.  The `-L'
  1241. causes a full-length line for each file giving its attributes, size,
  1242. creation date, and name.  The `-l' (small el) is the same as `-L'
  1243. except that the output is sorted by name.  The `-R' will cause the
  1244. subtrees of directories in the argument list of files to be traversed.  The
  1245. `-F' will append to each listed filename one char that indicates the
  1246. type of that file: `*' if it is executable (i.e., has an extension of
  1247. `.prg, .tos, .ttp', or `.g'), a `\' if its is a directory, a
  1248. ' ' otherwise.
  1249.  
  1250. `ls' always (even if DIR_CACHE is 1)
  1251. updates the directory cache for the relevant directories.
  1252.  
  1253.  
  1254. File: gulam.info  Node: mem, Prev: ls, Up: Glossary, Next: mkdir
  1255.  
  1256. mem
  1257. ---
  1258.  
  1259. `mem' shows the list of free chunks of memory available.  It does
  1260. this by following lists starting at an (undocumented) TOS location
  1261. (`0x7e8e' for ROMS dated 04221987, `56ec' for older ROMS),
  1262. Because of the way *Gulam* uses dynamically allocated memory,
  1263. the size of the largest free chunk fluctuates both up and down as
  1264. chunks get coalesced and split.
  1265.  
  1266.     `mem -a' shows not only the free list, but also GEMDOS list of
  1267. Malloc-ated chunks.
  1268.  
  1269.  
  1270. File: gulam.info  Node: metacharacter-expansion, Prev: io-redirection, Up: top, Next: path
  1271.  
  1272. Metacharacter Expansion
  1273. -----------------------
  1274.  
  1275. The characters `!$()[]><~*?', called "meta characters", have
  1276. special meaning to *Gulam*.  If it is necessary to embed these
  1277. characters in arguments to commands but without such special meaning, you
  1278. must enclose the argument in single-quotes.
  1279.  
  1280. Arguments (to built-in or external commands) that contain meta chars are
  1281. expanded as follows.  The `!' is expanded first; see History
  1282. Substitution.  After this, the meta chars `$()[]~*?' are expanded from
  1283. left-to-right.  See Dollar Substitution.  The wiggle `~' stands for
  1284. `$HOME'.  The remaining meta chars `()[]*?' are part of the
  1285. "fnmre" -- regular expressions for file names.  Fnmre are slightly
  1286. different from egrep's Regular Expressions.  An fnmre differs from re in
  1287. (1) `.' stands for itself; (2) `*' is matches zero or more arbitrary
  1288. characters.  Occurrences of an fnmre, outside of strings, are replaced by
  1289. the sorted blank-separated list of file names matching the fnmre; see also
  1290. File Names.
  1291.  
  1292.  
  1293. File: gulam.info  Node: mkdir, Prev: mem, Up: Glossary, Next: mv
  1294.  
  1295. mkdir
  1296. -----
  1297.      mkdir NAMES
  1298.  
  1299. The "mkdir" command creates new directories with the arguments as their
  1300. names.
  1301.  
  1302.  
  1303. more
  1304. ----
  1305.  
  1306. This is a built-in alias, if you will, to `ue -r'.
  1307.  
  1308.  
  1309. File: gulam.info  Node: mv, Prev: mkdir, Up: Glossary, Next: mson
  1310.  
  1311. mv
  1312. --
  1313.      mv FILENAMES TARGET-DIR
  1314.      mv FILENAME1 FILENAME2
  1315.  
  1316. Moves files.  In the first form, any number of files may be moveed into the
  1317. destination directory; files in the target dir will have their original
  1318. names.  In the second form, only one file is moved, and the new one will be
  1319. named filename2.  On the Atari ST, moving files is accomplished by copying
  1320. and then deleting the source file unless it is the second form and both are
  1321. in the same directory.
  1322.  
  1323.  
  1324. File: gulam.info  Node: mson, Prev: mv, Up: Glossary, Next: peekw
  1325.  
  1326. mson/msoff
  1327. ----------
  1328.  
  1329. These enable/disable the mouse.  Gulam/ue does not use the mouse; we intend
  1330. to in a good way.  Most GEM-based `.prg' programs use mouse, but do
  1331. not set it up themselves.  Some of these will hang if invoked from
  1332. *Gulam*, which is no big deal; do `mson' and then try.
  1333.  
  1334.  
  1335. File: gulam.info  Node: path, Prev: metacharacter-expansion, Up: top, Next: query-search-replace
  1336.  
  1337. PATH
  1338. ----
  1339.  
  1340. A comma-separated list (with no white chars) of directiries should be the
  1341. value of this environment variable.  This value is use by `rehash'
  1342. command.  `rehash' scans the files in each directory looking for
  1343. executable files (by def, files with extensions of .prg, .tos. .ttp, or
  1344. .g).  The leaf names and full pathnames are entered into a hash table.
  1345. Typing the `help' command (not the `HELP' key) will list the hash
  1346. table in brief; `which' command lists it in full.  *Gulam* does
  1347. NOT auto rehash whenever PATH is changed (which I will change if a lot of
  1348. you think it should).
  1349.  
  1350.      setenv PATH c:,c:\bin,d:\mwc\bin 
  1351.  
  1352.  
  1353. File: gulam.info  Node: peekw, Prev: mson, Up: Glossary, Next: popd
  1354.  
  1355. peekw/pokew
  1356. -----------
  1357.  
  1358. `peekw' and `pokew' are similar to their namesakes in BASIC.  We
  1359. use privileged mode to alter/access any arbitrary location.  These commands
  1360. expect their arguments to be hex numbers, so do not begin the numbers with
  1361. `0x', or `$'.  The pokew command should be used with care.
  1362.  
  1363.      peekw 420      # shows you what is at word at 0x420 
  1364.      pokew 420 123E # sets word at 0x420 to 0x123E 
  1365.  
  1366. The primary use for these is to examine/alter the TOS variables.  Refer to
  1367. BIOS Hitch Hikers Guide, ST Internals, or some other documentation for a
  1368. full list of these locations.  Here are a few that I often found useful:
  1369.  
  1370. `420 memvalid' Normally contains 0x7520.  If you then press reset the
  1371. ST will do a `warm boot' (which leaves most reset survivable RAM disks to
  1372. be still alive).  If you want to cause a cold boot, `pokew' this
  1373. location to a zero.  (The other way is to power cycle.)
  1374.  
  1375. `42E' and `0x430 phystop' This pair of integers (a long) gives
  1376. the address of top of RAM.
  1377.  
  1378. `440 seekrate' contains a code for the seek rate of floppies: 0 means
  1379. 6 msec, 1 means 12 msec, 2 means 2 msec, and 3 means 3 msec.
  1380.  
  1381. `444 fverify' If `pokew' to zero, disk writes are not verified; any
  1382. other value will.
  1383.  
  1384.  
  1385. File: gulam.info  Node: popd, Prev: peekw, Up: Glossary, Next: print
  1386.  
  1387. popd
  1388. ----
  1389.  
  1390. The `popd' command changes the shell's working directory to the one on
  1391. top of the directory stack.  Also, sets `cwd', and `CWD'.
  1392.  
  1393.  
  1394. File: gulam.info  Node: print, Prev: popd, Up: Glossary, Next: printenv
  1395.  
  1396. print
  1397. -----
  1398.      print FILENAMES
  1399.  
  1400. The print command is used to prepare listings of the contents of files with
  1401. headers giving the name of the file and the date and time at which the file
  1402. was last modified.
  1403.  
  1404.  
  1405. File: gulam.info  Node: printenv, Prev: print, Up: Glossary, Next: pushd
  1406.  
  1407. printenv
  1408. --------
  1409.  
  1410. The `printenv'  command  is equiv to setenv with no args.  
  1411.  
  1412.  
  1413. $prompt
  1414. -------
  1415.  
  1416. *Gulam* prompts for input with the contents of this variable.  Set
  1417. it with set command.
  1418.  
  1419.      set prompt      '$ncmd $cwd gu > $u' 
  1420.  
  1421.  
  1422. File: gulam.info  Node: pushd, Prev: printenv, Up: Glossary, Next: pwd
  1423.  
  1424. pushd
  1425. -----
  1426.      pushd [DIR]
  1427.  
  1428. The `pushd' (push directory) command pushes the name of the current
  1429. directory on to the internal stack, and `cd''s to the directory given
  1430. by the argument.  You can later do a `popd' to return to the present
  1431. current directory.  The command `pushd', without arguments, exchanges
  1432. the working directory with the one on top of the stack.
  1433.  
  1434.  
  1435. File: gulam.info  Node: pwd, Prev: pushd, Up: Glossary, Next: rehash
  1436.  
  1437. pwd
  1438. ---
  1439.  
  1440. This built-in command prints the full pathname of the current working
  1441. directory.
  1442.  
  1443.  
  1444. File: gulam.info  Node: query-search-replace, Prev: path, Up: top, Next: regular-expressions
  1445.  
  1446. Query Search/Replace
  1447. --------------------
  1448.  
  1449. The built-in `ue' uses regular expression search and replace; see
  1450. Regular Expressions.  This function is normally bound to `ESC-%'.  When
  1451. you invoke it, it will ask you to type the search pattern, and then the
  1452. replace pattern.  It then enters the search/replace mode: finds the next
  1453. (to the right, and below) occurrence of the search pattern, and awaits your
  1454. response.  You type
  1455.   1. a `SPACE' to replace the occurrence of the
  1456.      search pattern
  1457.   2. a `DELETE' to skip to the next occurrence
  1458.   3. a dot (`.') to replace this one and then terminate search/replace
  1459.   4. `ESC' to end the search/replace right now, and
  1460.   5. an exclamation (`!') to replace this and all further occurrences without
  1461.      bothering to ask you.
  1462.  
  1463. If you forget all this, type an arbitrary key and you will get the brief
  1464. reminder:
  1465.  
  1466.      <SP>replace, [.]rep-end, <DEL>don't, [!]repl rest, <ESC>quit
  1467.  
  1468. The only char that has a special meaning in the replace string is `&'; all
  1469. other meta-chars stand literally for themselves.  An `&' stands for the
  1470. substring that matched the whole regular expression.  A `\n', where n is a
  1471. digit in 1 to 9, stands for the substring that matched the n-th
  1472. parenthesized expression within the regular expression, with parenthesized
  1473. expressions
  1474. numbered in left-to-right order of their opening parentheses.  
  1475.  
  1476. Be aware of a peculiarity of the search/replace: The `^' and `$'
  1477. of the regular expression match the positions just right of the dot, and
  1478. just left of the dot.  Thus, if you give a search string of '`^'', and
  1479. replace string '`a'', and then issue a '`!'', you will be
  1480. inserting '`a'' forever (until `ue' runs out of memory).
  1481.  
  1482.  
  1483. File: gulam.info  Node: regular-expressions, Prev: query-search-replace, Up: top, Next: strings
  1484.  
  1485. Regular Expressions
  1486. -------------------
  1487.  
  1488. [This  section  is a mildly edited man page of regexp(3) by Henry
  1489. Spencer.] 
  1490.  
  1491. A  regular  expression  is  zero  or  more branches, separated by
  1492. `|'.  It matches anything that matches one of the branches.  
  1493.  
  1494. A  branch  is  zero  or  more pieces, concatenated.  It matches a
  1495. match for the first, followed by a match for the second, etc.  
  1496.  
  1497. A  piece  is  an  atom possibly followed by `*', `+', or `?'.  An
  1498. atom  followed  by `*' matches a sequence of 0 or more matches of
  1499. the  atom.   An  atom  followed by `+' matches a sequence of 1 or
  1500. more  matches  of  the  atom.   An atom followed by `?' matches a
  1501. match of the atom, or the null string.  
  1502.  
  1503. An  atom is a regular expression in parentheses (matching a match
  1504. for  the  regular expression), a range (see below), `.' (matching
  1505. any  single  character),  `^'  (matching  the  null string at the
  1506. beginning  of the input string), `$' (matching the null string at
  1507. the  end  of  the  input  string),  a  `e'  followed  by a single
  1508. character  (matching  that character), or a single character with
  1509. no other significance (matching that character).  
  1510.  
  1511. A  range  is  a  sequence  of  characters  enclosed  in `[]'.  It
  1512. normally  matches any single character from the sequence.  If the
  1513. sequence  begins  with  `^',  it matches any single character not
  1514. from  the  rest  of  the  sequence.   If  two  characters  in the
  1515. sequence  are  separated  by  `-', this is shorthand for the full
  1516. list  of  ASCII characters between them (e.g. `[0-9]' matches any
  1517. decimal  digit).   To include a literal `]' in the sequence, make
  1518. it  the first character (following a possible `^').  To include a
  1519. literal `-', make it the first or last character.  
  1520.  
  1521. If  a  regular  expression could match two different parts of the
  1522. input  string,  it  will match the one which begins earliest.  If
  1523. both  begin  in  the  same  place but match different lengths, or
  1524. match  the  same  length in different ways, life gets messier, as
  1525. follows.  
  1526.  
  1527. In   general,  the  possibilities  in  a  list  of  branches  are
  1528. considered  in  left-to-right  order,  the possibilities for `*',
  1529. `+',  and `?' are considered longest-first, nested constructs are
  1530. considered  from  the  outermost  in, and concatenated constructs
  1531. are  considered leftmost-first.  The match that will be chosen is
  1532. the  one  that  uses the earliest possibility in the first choice
  1533. that  has to be made.  If there is more than one choice, the next
  1534. will  be  made  in the same manner (earliest possibility) subject
  1535. to the decision on the first choice.  And so forth.  
  1536.  
  1537. For  example,  `(ab|a)b*c'  could match `abc' in one of two ways.
  1538. The  first choice is between `ab' and `a'; since `ab' is earlier,
  1539. and  does  lead  to  a  successful  overall  match, it is chosen.
  1540. Since  the  `b'  is  already  spoken for, the `b*' must match its
  1541. last  possibility  the  empty  string  since  it must respect the
  1542. earlier choice.  
  1543.  
  1544. In  the  particular  case  where no `|'s are present and there is
  1545. only  one  `*',  `+',  or `?', the net effect is that the longest
  1546. possible   match  will  be  chosen.   So  `ab*',  presented  with
  1547. `xabbbby',  will  match  `abbbb'.   Note  that  if `ab*' is tried
  1548. against  `xabyabbbz',  it  will match `ab' just after `x', due to
  1549. the  begins-earliest  rule.  (In effect, the decision on where to
  1550. start  the match is the first choice to be made, hence subsequent
  1551. choices   must   respect   it   even   if   this  leads  them  to
  1552. less-preferred alternatives.) 
  1553.  
  1554. Here are some examples of usage: 
  1555.  
  1556.      ls *[sg]        # print file names ending in s or g
  1557.      egrep '(MWC|MEGAMAX)' *.c       
  1558.      egrep '^$' *.c  # print line numbers of empty lines
  1559.      egrep 'aa*' *.c
  1560.  
  1561.  
  1562. File: gulam.info  Node: rehash, Prev: pwd, Up: Glossary, Next: ren
  1563.  
  1564. rehash
  1565. ------
  1566.  
  1567. -- see PATH 
  1568.  
  1569.  
  1570. File: gulam.info  Node: ren, Prev: rehash, Up: Glossary, Next: rm
  1571.  
  1572. ren
  1573. ---
  1574.      ren FNM1 FNM2
  1575.  
  1576. Rename file FNM1 as FNM2; they both must be in the same
  1577. directory.
  1578.  
  1579.  
  1580. File: gulam.info  Node: rm, Prev: rx, Up: Glossary, Next: ren
  1581.  
  1582. rm
  1583. --
  1584.      rm FILENAMES
  1585.  
  1586. `rm' removes the named files.  Most of us have the following aliases
  1587. in our `gulam.g' files:
  1588.  
  1589.      alias rm rm -i 
  1590.      alias Rm rm 
  1591.  
  1592. which queries you, for each file, before deleting it.  We use `Rm'
  1593. when we are really sure we want to delete the file(s).  There is
  1594. no  special check to see if you typed `rm *.*' or `rm *'; both of
  1595. these will clear your current directory.  
  1596.  
  1597.  
  1598. File: gulam.info  Node: rx, Prev: rm, Up: Glossary, Next: set
  1599.  
  1600. rx/sx
  1601. -----
  1602.  
  1603. These are built-in commands.  `rx' receives a file from the remote
  1604. system; and `sx' sends a file to the remote system using Xmodem
  1605. protocol.
  1606.  
  1607.      rx FNM
  1608.  
  1609. command opens/creates file FNM for writing.  If the shell variable
  1610. `rx_remote_cmd' is set, *Gulam* constructs a command for the
  1611. remote system as `$rx_remote_cmd' FNM, and sends this command
  1612. through the rs232 port, and then awaits the packets.  For use with our
  1613. 4xBSD Unix, we set this var to `xm st'.  Unless the `xm' on the
  1614. remote machine is of the quiet type (one that does not respond with, say,
  1615. `Xmodem: Ready to send...'), setting `rx_remote_cmd' actually
  1616. prolongs the first synchronization.  If this var is unset, you should first
  1617. switch to remote (say using te command), and issue the appropriate command
  1618. to the remote, and then switch back to AtariST and give the `rx'
  1619. FNM command.
  1620.  
  1621.      sx FNM
  1622.  
  1623. is essentially similar.  *Gulam* opens FNM for reading, sends
  1624. `$sx_remote_cmd' FNM, if that var is set, and awaits the first
  1625. sync.  For our 4xBSD Unix, we set `sx_remote_cmd' to `xm rt'.
  1626.  
  1627. If sending/receiving binary files use `xm rb' or `xm sb'.  Note
  1628. that files received with Xmodem usually contain extraneous bytes at the
  1629. very end of the file.  With text files, you often see a bunch of
  1630. `^Z's.
  1631.  
  1632.  
  1633. File: gulam.info  Node: set, Prev: rx, Up: Glossary, Next: setenv
  1634.  
  1635. set
  1636. ---
  1637.      set [NAME VALUE]
  1638.  
  1639. The built-in `set' command is used to assign new values to shell
  1640. variables and to show the values of the current variables.  The command
  1641. without any arguments lists all the shell vars and their values.  When
  1642. arguments are present, second and subsequent words are processed as an
  1643. expression yielding a value which is then assigned to the first argument.
  1644. The `unset' command deletes a variable.
  1645.  
  1646.      set i  {  $j > 10 } # sets i to 1 if $j is > 10; to 0 otherwise 
  1647.      set x "hi there" 
  1648.      set y $i + 4 @ 2     # @ stands for multiplication 
  1649.  
  1650.  
  1651. File: gulam.info  Node: setenv, Prev: set, Up: Glossary, Next: source
  1652.  
  1653. setenv
  1654. ------
  1655.  
  1656. Variables in the environment can be changed by using the `setenv'
  1657. built-in command.  The `setenv' command without args prints the values
  1658. of all the variables in the environment.
  1659.  
  1660.  
  1661. File: gulam.info  Node: source, Prev: setenv, Up: Glossary, Next: te
  1662.  
  1663. source
  1664. ------
  1665.      source FILE-NAME
  1666.  
  1667. The contents of file FILE-NAME are excuted by *Gulam*.  Unless
  1668. the FILE-NAME has an extension other than .g, use the simpler command
  1669. `file.g' instead.
  1670.  
  1671.  
  1672. status
  1673. ------
  1674.  
  1675. A command normally returns a status when it finishes.  By convention a
  1676. status of zero indicates that the command succeeded, and *Gulam*
  1677. does not show this value.  Commands may return non-zero status, whic is
  1678. displayed, to indicate that some abnormal event has occurred.  The shell
  1679. variable status is set to the status returned by the last command.
  1680.  
  1681.  
  1682. File: gulam.info  Node: strings, Prev: regular-expressions, Up: top, Next: file-name-completion
  1683.  
  1684. Strings
  1685. -------
  1686.  
  1687. Strings are the most common data type that shells deal with.  In
  1688. *Gulam*, unless otherwise stated, all operands are considered to be
  1689. strings.  There are a few occasions when it is necessary to suppress the
  1690. typical string preprocessing such as meta-char expansion.  Such strings are
  1691. enclosed in single-quotes.  A string enclosed in double quotes is dollar-,
  1692. and meta-expanded, and then enclosed in double quotes.  Try, `echo
  1693. *.c' and `echo '*.c'' in a directory that has a few files with the
  1694. `.c' extension.  Within a quoted-string, you can include control
  1695. characters by inserting a `' (control-Q) followed by the octal
  1696. ASCII code (always using 3 digits) of the character; see the `gulam.g'
  1697. section for examples.  In general, if you want to set a var to a string
  1698. that contains control-chars, first write it out in the C language notation,
  1699. and replace each back-slash with a `control-Q'.
  1700.  
  1701.  
  1702. File: gulam.info  Node: te, Prev: source, Up: Glossary, Next: time
  1703.  
  1704. te/teexit
  1705. ---------
  1706.  
  1707. `te' (also  bound to `Keypad-0') gets you into the built-in terminal
  1708. emulator.   If  you have baud_rate set up properly (see gulam.g),
  1709. the  rs232  port  is set to that speed, and you are switched to a
  1710. fresh  screen.   Set  `sz_rs232_buffer'  to  a  large  value if you
  1711. encounter  XON/XOFF  problems  too frequently.  We have  used the
  1712. following  TERMCAP  and  used  vi,  GNU-Emacs  etc  without  any
  1713. problems.  
  1714.  
  1715.      st|st25|atariST|520 or 1040, bw, std sys font, 25 lines, 80 col:
  1716.              :ae=Eba:al=EL:am:as=Ebc:
  1717.              :bl=^G:bs:
  1718.              :cd=EJ:ce=EK:cl=EHEJ:cm=EY%+ %+ :co#80:cr=^M:
  1719.              :dl=EM:do=EB:
  1720.              :ho=EH:
  1721.              :is=EvEe:
  1722.              :kd=274:kh=216:kl=275:kr=276:ku=273:
  1723.              :le=^H:li#25:
  1724.              :nd=EC:nl=^J:
  1725.              :pt:
  1726.              :se=Eq:so=Ep:sr=EI:
  1727.              :ta=^I:
  1728.              :up=EA:
  1729.      
  1730.      
  1731.      ST|ST25|atariSTcolor|as above but with color for standout :
  1732.              :ae=Eba:al=EL:am:as=Ebc:
  1733.              :bl=^G:bs:
  1734.              :cm=EY%+ %+ :co#80:li#25:cr=^M:cd=EJ:ce=EK:cl=EHEJ:
  1735.              :dl=EM:do=^J:
  1736.              :ho=EH:
  1737.              :is=EvEe:
  1738.              :kd=274:kh=216:kl=275:kr=276:ku=273:
  1739.              :le=^H:
  1740.              :nd=EC:nl=^J:
  1741.              :pt:
  1742.              :so=Ec2Eb3:se=Ec0Eb3:sr:EI:
  1743.              :ta=^I:
  1744.              :up=EA:
  1745.      
  1746.      sT|st50|AtariST emulating vt52, bw, 50 lines, 80 col:
  1747.              :ae=Eba:al=EL:am:as=Ebc:
  1748.              :bl=^G:bs:
  1749.              :cd=EJ:ce=EK:cl=EHEJ:cm=EY%+ %+ :co#80:cr=^M:
  1750.              :dl=EM:do=^J:
  1751.              :ho=EH:
  1752.              :is=EvEe:
  1753.              :kd=274:kh=216:kl=275:kr=276:ku=273:
  1754.              :le=^H:li#50:
  1755.              :nd=EC:nl=^J:
  1756.              :pt:
  1757.              :se=Eq:so=Ep:sr=EI:
  1758.              :ta=^I:
  1759.              :up=EA:
  1760.  
  1761. To return to the local mode after having done `te', press `UNDO'.
  1762. Then a `Keypad-0' will take you back to remote with your remote screen
  1763. in tact.  After you are finally done with your remote system, press
  1764. `UNDO', and then issue a `teexit' to reclaim the 32k used for the
  1765. extra screen.
  1766.  
  1767.  
  1768. File: gulam.info  Node: file-name-completion, Prev: strings, Up: top
  1769.  
  1770. Tenex File Name Completion
  1771. --------------------------
  1772.  
  1773. Tenex is widely considered to be the first OS to implement the completion
  1774. of a file's name given the first few chars of it.  Experiment with the keys
  1775. marked `INSERT', `TAB' and `CLR/HOME', while you are in
  1776. *mini*.  If you are in buffer *gulam*, use `ESC-ESC' (2
  1777. escapes).  See File Names.
  1778.  
  1779.  
  1780. File: gulam.info  Node: time, Prev: te, Up: Glossary, Next: touch
  1781.  
  1782. time
  1783. ----
  1784.  
  1785. The word `time' when prefixed to a regular command, it prints the
  1786. elapsed time after the command finishes.  If you set variable
  1787. named `time'  to  a non-zero value, each and every command, even
  1788. if  they  are  not  prefixed  with  the  word `time',  will be so
  1789. timed.  
  1790.  
  1791.      time  ls -lF c:\        # See how long it takes 
  1792.      set   time  1           # After this, all command will be timed until 
  1793.      set   time 0            # you do this, or 
  1794.      unset time              # this 
  1795.  
  1796. If you set up aliases with `time' prefixes in them, watch out!  The
  1797. discussion under the section on Gem is applicable to `time' also.
  1798.  
  1799.  
  1800. File: gulam.info  Node: touch, Prev: time, Up: Glossary, Next: ue
  1801.  
  1802. touch
  1803. -----
  1804.      touch FNMS
  1805.  
  1806. `touch'  updates  the  time  stamp on the files to current time and
  1807. date.  
  1808.  
  1809.  
  1810. File: gulam.info  Node: ue, Prev: touch, Up: Glossary, Next: uekb
  1811.  
  1812. ue
  1813. --
  1814.      ue [-r] [FNMS]
  1815.  
  1816. This command takes you into the built-in microEmacs editor.  If
  1817. no  args  are  given,  you  will  land  in  the  *gulam*  buffer,
  1818. otherwise in the buffer of the last named file.  The output of
  1819. *Gulam* commands executed while you are within *gulam* is
  1820. entered into that buffer; this, of course, consumes malloc-space.
  1821. `Meta-g' brings you into *gulam* if you are in another buffer.
  1822.  
  1823. To examine the key bindings, press `HELP'-key first, and then a `B'
  1824. while inside `ue'.  To rebind them to suit your tastes, see `kb'.
  1825. On the Atari ST, all the keys are bound (thoughtfully, I hope) to useful
  1826. commands.  `F1' through `F5' delete things; `F6-F10' update
  1827. files and buffers; Keypad keys cause harmless cursor motions; `Keypad
  1828. 0' (zero) switches you to the (remote computer hooked to the) rs232 port;
  1829. to return to your local Atari, press `UNDO'.  `HELP' is for (not
  1830. much) help; `UNDO' will exit after saving files; the rest of the keys
  1831. in that group move the cursor around.
  1832.  
  1833. The `-r' flag causes the buffers of the files following the `-r'
  1834. to be marked as read-Only.  You can still edit these buffers; but the
  1835. read-Only mark causes `ue' to ask before writing to these files.
  1836.  
  1837. Do try `^Z, ^X-!' and `Meta-X-!' commands.  
  1838.  
  1839.  
  1840. File: gulam.info  Node: uekb, Prev: ue, Up: Glossary, Next: unalias
  1841.  
  1842. uekb
  1843. ----
  1844.  
  1845. The command `uekb' has been renamed as `kb'.
  1846.  
  1847.  
  1848. File: gulam.info  Node: unalias, Prev: uekb, Up: Glossary, Next: unset
  1849.  
  1850. unalias
  1851. -------
  1852.      unalias [ALIASSED-NAME]
  1853.  
  1854. The unalias command removes aliases.   
  1855.  
  1856.  
  1857. File: gulam.info  Node: unset, Prev: unlalias, Up: Glossary, Next: which
  1858.  
  1859. unset unsetenv
  1860. --------------
  1861.      unset [VAR-NAME]
  1862.      unsetenv [ENV-VAR]
  1863.  
  1864. The unset command removes the definitions of shell variables.  
  1865.  
  1866.  
  1867. variables
  1868. ---------
  1869.  
  1870. See also: *Gulam* Vars and Environment; Dollar Subst.  
  1871.  
  1872. A variable name is any sequence of characters not containing delimiters.  A
  1873. Variable in *Gulam* holds a string as its value.  Depending on the
  1874. context this string is evaluated to yield a numeric value.
  1875.  
  1876.  
  1877. File: gulam.info  Node: which, Prev: unset, Up: Glossary, Next: while
  1878.  
  1879. which
  1880. -----
  1881.  
  1882. The `which' command displays the internal table of names of external
  1883. commands, and the full pathnames of the files that contain them.  If
  1884. nothing  gets  displayed,  either  you did not do a `rehash', did
  1885. not  setenv  the PATH, or none of the directories in PATH had any
  1886. executables.  
  1887.  
  1888.  
  1889. File: gulam.info  Node: while, Prev: which, Up: Glossary
  1890.  
  1891. while
  1892. -----
  1893.  
  1894. The `while' built-in control construct is used in shell command
  1895. scripts.  Instead of echo and set in the body of the loop shown below, you
  1896. can use other commands.
  1897.  
  1898.      set i 10 
  1899.      while  { $i >  0 } 
  1900.            echo $i 
  1901.            set i $i - 1 
  1902.      endwhile 
  1903.  
  1904.  
  1905. File: gulam.info  Node: Variables Index, Prev: top, Up: top, Next: Command Index
  1906.  
  1907. Variable Index
  1908. **************
  1909.  
  1910.  
  1911. * Menu:
  1912.  
  1913. * $CWD: cp.
  1914. * $cwd: cp.
  1915. * $end_style: endfor.
  1916. * $HOME: history-substitutions.
  1917. * $home: history-substitutions.
  1918. * $prompt: printenv.
  1919. * batch_echo: gulam.g.
  1920. * batch_max_nesting: gulam.g.
  1921. * baud_rate: gulam.g.
  1922. * CWD: gulam.g.
  1923. * cwd: gulam.g.
  1924. * delay: gulam.g.
  1925. * dir_cache: gulam.g.
  1926. * ginprompt: gulam.g.
  1927. * gulam_help_file: gulam.g.
  1928. * gulam_help_file: gulam.g.
  1929. * histfile: gulam.g.
  1930. * HOME: gulam.g.
  1931. * home: gulam.g.
  1932. * mscursor: gulam.g.
  1933. * ncmd: gulam.g.
  1934. * PATH: gulam.g.
  1935. * path: gulam.g.
  1936. * PATH: mson.
  1937. * prompt : gulam.g.
  1938. * prompt_tail: gulam.g.
  1939. * pr_bof: gulam.g.
  1940. * pr_eof: gulam.g.
  1941. * pr_eol : gulam.g.
  1942. * pr_eop: gulam.g.
  1943. * RGB: gulam.g.
  1944. * rgb: gulam.g.
  1945. * rx_remote_cmd: gulam.g.
  1946. * semicolon_max: gulam.g.
  1947. * status: gulam.g.
  1948. * status: source.
  1949. * sx_remote_cmd: gulam.g.
  1950. * sz_rs232_buffer: gulam.g.
  1951. * time: gulam.g.
  1952. * verbosity: gulam.g.
  1953.  
  1954.  
  1955. File: gulam.info  Node: Command Index, Prev: Variables Index, Up: top
  1956.  
  1957. Command Index
  1958. *************
  1959.  
  1960.  
  1961. * Menu:
  1962.  
  1963. * alias: builtins.
  1964. * builtins: Glossary.
  1965. * cat: alias.
  1966. * cd: cat.
  1967. * chmod: cd.
  1968. * cp: chmod.
  1969. * date: cp.
  1970. * df: date.
  1971. * dirc: dm.
  1972. * dirs: dirc.
  1973. * dir_cache: dm.
  1974. * dm: df.
  1975. * echo: dollar-substitutions.
  1976. * ef: echo.
  1977. * egrep: ef.
  1978. * egrep: gem.
  1979. * endfor: endif.
  1980. * endif: egrep.
  1981. * exit: endfor.
  1982. * fg: expressions.
  1983. * fgrep: gem.
  1984. * file-names: fg.
  1985. * foreach: flags.
  1986. * format: foreach.
  1987. * gem: format.
  1988. * grep: gem.
  1989. * help: gulam.g.
  1990. * history: help.
  1991. * if: history-substitutions.
  1992. * kb: io-redirection.
  1993. * lpr: kb.
  1994. * ls: lpr.
  1995. * mem: ls.
  1996. * mkdir: metacharacter-expansion.
  1997. * msoff: mv.
  1998. * mson: mv.
  1999. * mv: mkdir.
  2000. * peekw: path.
  2001. * pokew: path.
  2002. * popd: peekw.
  2003. * print: popd.
  2004. * printenv: print.
  2005. * pushd: printenv.
  2006. * pwd: pushd.
  2007. * rehash: regular-expressions.
  2008. * ren: rehash.
  2009. * rm: ren.
  2010. * rx: rm.
  2011. * set: rx.
  2012. * setenv: set.
  2013. * source: setenv.
  2014. * sx: rm.
  2015. * te: strings.
  2016. * teexit: strings.
  2017. * time: file-name-completion.
  2018. * touch: time.
  2019. * ue: touch.
  2020. * uekb: ue.
  2021. * unalias: uekb.
  2022. * unset: unalias.
  2023. * unsetenv: unalias.
  2024. * which: unset.
  2025. * while: which.
  2026.